﻿using System.Windows.Forms;

class Vehicle
{
    protected int wheels;
    protected float weight;

    public void SetVehicle(int wheels, float weight)
    {
        this.wheels = wheels;
        this.weight = weight;
    }

    public virtual void GetVehicle()
    {
        MessageBox.Show($"车轮数: {wheels}\n车重量: {weight}");
    }
}

class Truck : Vehicle
{
    private float maxLoad, oilPerKm;

    public void SetVehicle(int wheels, float weight, float maxLoad, float oilPerKm)
    {
        this.wheels = wheels;
        this.weight = weight;
        this.maxLoad = maxLoad;
        this.oilPerKm = oilPerKm;
    }

    public bool Overload(float nowLoad)
    {
        return nowLoad > maxLoad;
    }

    public float OilConsumption(float runKm)
    {
        return runKm * oilPerKm;
    }

    public new void GetVehicle()
    {
        MessageBox.Show($"车轮数: {wheels}\n车重量: {weight}\n载重量: {maxLoad}\n每公里耗油: {oilPerKm}");
    }
}